home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: May 2000
- //
- //
- //
- // Procedure Name:
- // artFluidAttrAutoSaveInitialStateCurrentFluid
- //
- // Description:
- // Normally, this would be just as simple as a
- // "performFluids 1 FluidSave 0" but in case the selection
- // list has changed, we're still holding on to an autoSave
- // flag for the last painted fluid (which might no longer
- // be selected!) so we might need to reselect the fluid before
- // invoking the performFluids autoSave cmd...
- //
- // Return Value:
- // None.
- //
- global proc artFluidAttrAutoSaveInitialStateCurrentFluid( string $tool )
- {
- // We're responding to an "autoSave" request... Check and
- // see if the fluid we want to save is actually on the selection
- // list. If not, invoking FluidSave will produce an error, so
- // we'd better select it beforehand.
- //
- string $fluid = `artFluidAttrCtx -q -currentPaintableFluid $tool`;
- if( size( $fluid ) == 0 ) {
- return;
- }
-
- string $selList[] = `ls -sl`;
- int $fluidSelected = ( stringArrayCount( $fluid, $selList ) > 0 );
- if( !$fluidSelected ) {
- select $fluid;
- }
-
- // Save the state.
- //
- SetInitialState;
-
- // Restore the selection list if we need to.
- //
- if( !$fluidSelected ) {
- select $selList;
- }
- }
-